//手动实现findex,findexIndex
let arr=[3,5,6,7,9];
Array.prototype.find=function(fn){
for(var i=0;i<this.length;i++){
    if(fn(this[i],i,this)){
        return i
    }
   
}
}
let newArr=arr.find((item,index,arry)=>{
    return item<5
})
console.log(newArr)
let arr1=[0,4,5,6];
Array.prototype.findIndex=function(fn){
    for(var i=0;i<this.length;i++){
        if(fn(this[i],i,this)){
            return i
        }
        return -1
    }
}
let newArr1=arr1.findIndex((item,index,arry)=>{
    return item>5
})
console.log(newArr1)//-1